<?php 
print_r($argv[1]);

$c = file_get_contents('index.tpl');
$d = str_replace('#filename#',$argv[1],$c);

file_put_contents('index.php',$d);